<!--
 * @Author: jackning 270580156@qq.com
 * @Date: 2024-08-20 19:51:55
 * @LastEditors: jackning 270580156@qq.com
 * @LastEditTime: 2024-08-20 20:39:29
 * @Description: bytedesk.com https://github.com/Bytedesk/bytedesk
 *   Please be aware of the BSL license restrictions before installing Bytedesk IM – 
 *  selling, reselling, or hosting Bytedesk IM as a service is a breach of the terms and automatically terminates your rights under the license. 
 *  仅支持企业内部员工自用，严禁私自用于销售、二次销售或者部署SaaS方式销售 
 *  Business Source License 1.1: https://github.com/Bytedesk/bytedesk/blob/main/LICENSE 
 *  contact: 270580156@qq.com 
 *  技术/商务联系：270580156@qq.com
 * Copyright (c) 2024 by bytedesk.com, All Rights Reserved. 
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Electron/Python</title>
</head>

<body>
    <h1>Hello Electron/Python</h1>
    <script>
        //use fetch API to get data from python and you can 
            // also send data please read more about flask
            fetch(`http://127.0.0.1:8200/get-name?name=Abdelkader`,
                {
                    method: "GET",
                    headers: {
                        Accept: "application/json",
                        "Content-Type": "application/json",
                    },
                }
            ).then(res => res.json()).then((data) => {
                //data.result should have the result from python script
                //put the result inside the h1 tag 
                document.getElementsByTagName("h1")[0].innerText = data.result;

            })
    </script>
</body>

</html>